if (!jsx3.lang.Class.forName("ux.cdb.admin.mechanism.cooOrg.CooOrgWizard")) {
/**
 * Define the <code>ux.cdb.admin.mechanism.cooOrg.CooOrgInvest.builder.Builder</code> class.
 * This class inherit from <code>jsx3.gui.Dialog<code> GUI class.
 */
jsx3.Class.defineClass(
		"ux.cdb.admin.mechanism.cooOrg.CooOrgWizard",
		jsx3.gui.Dialog,
		null,
		function (objRoot) {
			/**
			 * This method will be called after UI file has deserialized.
			 */
			objRoot.prototype.isEdit=null; //the flag whether current mode is edit,come from CooOrg.js
			objRoot.prototype.isSelType=false; //the flag whether current mode is seltype come from CooOrg.js,cancel it, to select type for search use new dialog not reuse it more.
			objRoot.prototype.parent=null; //the parent of this wizard.come from CooOrg.js
			objRoot.prototype.orgType=null; //the flag about  which type will be edit,come from cooorg.js
			objRoot.prototype.orgId=null;//the id which organization will be edit,come from cooorg.js
			objRoot.prototype.orgName=null;//the name which organization will be edit,come from cooorg.js 
			objRoot.prototype.regAddrId=null; //save addressid for edit mode when address info edit
			objRoot.prototype.offAddrId=null;//save addressid for edit mode when address info edit
			objRoot.prototype.callLoanAssistCenterCache = function() {
				var me=this;
				//this.getDescendantOfName('steppedWizard').setEnableStepJump(true);
				

			}
			
			
			objRoot.prototype.onClose = function() {
				this.doClose();
			}
			objRoot.prototype.loadContent = function() {
				if (this.isEdit)
				{
					this.getDescendantOfName("windowBar").setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@Mechanism@CooOrg@BuilderTitleEdit"));
					this.getDescendantOfName("windowBar").repaint();
					this.loadWizard(this.orgType);
				}
				else
				{// the operation is add
					//load organization type selection
					var content=this.getDescendantOfName("blkContent");
					content.removeChildren();
					ux.megatron.Main.loadUIResourceAsync(content, "ux.cdb.admin", "ux/cdb/admin/mechanism/cooOrg/CooOrgInvest/builder/ui/CooOrgSelectType.xml", null);
					//set title
					this.getDescendantOfName("windowBar").setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@Mechanism@CooOrg@BuilderTitleNew"));
					this.getDescendantOfName("windowBar").repaint();
				}
			}
			//when user selected a type and click next
			objRoot.prototype.selectedType = function(){
				var matrix = this.getDescendantOfName("mtxCooOrgType");
				var orgType=null;

				if (matrix.getSelectedNodes().size() > 0) {
					orgType=matrix.getSelectedNodes().get(0).getAttribute("jsxtext");
					
					/* disabled these tpyes
					if ((orgType == "投融资类") ||(orgType=="担保类") ||(orgType=="信用协会") ||(orgType=="合作办"))
					{
						 this.loadWizard(orgType);
					}
					*/
					
					if (this.isSelType) {
						if (matrix.getSelectedNodes().get(0).getAttribute("jsxcanselect") == "1") {
							//the node can be selected
							this.parent.searchTypeSelected(orgType);
							this.doClose();
						}
					}
					else {
						if (orgType == "学生资助中心") {
							this.orgType="学生资助中心";
							this.loadWizard(this.orgType);
						}
					}
					
				}
				else{
					return;
				}
				
			}
			objRoot.prototype.onCancel = function(){
				if (this.isSelType) {
					this.parent.searchTypeSelected("");
				}
				this.doClose();
			}
			
			//load wizard
			objRoot.prototype.loadWizard=function(orgType)
			{
				var content=this.getDescendantOfName("blkContent");
				var me=this;
				

				content.removeChildren();
				if (orgType == "投融资类") {
					ux.megatron.Main.loadUIResourceAsync(content, "ux.cdb.admin", "ux/cdb/admin/mechanism/cooOrg/CooOrgInvest/builder/ui/CooOrgInvestBuildDialog.xml", null);
				}
				if (orgType == "担保类") {
					ux.megatron.Main.loadUIResourceAsync(content, "ux.cdb.admin", "ux/cdb/admin/mechanism/cooOrg/CooOrgAssure/builder/ui/CooOrgAssureBuildDialog.xml", null);
				}
				if (orgType == "信用协会") {
					ux.megatron.Main.loadUIResourceAsync(content, "ux.cdb.admin", "ux/cdb/admin/mechanism/cooOrg/CooOrgCredit/builder/ui/CooOrgCreditBuildDialog.xml", null);
				}
				if (orgType == "合作办") {
					ux.megatron.Main.loadUIResourceAsync(content, "ux.cdb.admin", "ux/cdb/admin/mechanism/cooOrg/CooOrgCoop/builder/ui/CooOrgCoopBuildDialog.xml", null);
				}
				if (orgType == "学生资助中心") {
					ux.megatron.Main.loadUIResourceAsync(content, "ux.cdb.admin", "ux/cdb/admin/mechanism/cooOrg/CooOrgLoanAssist/builder/ui/CooOrgLoanAssistBuildDialog.xml",null);
				}
				
			}
			
		});
}